package com.demoworld.com.whitetiger;

/**
 * Created by francislee on 24/07/2017.
 */
public class ESResult {
    public ESResult(){
        this.returnCode = Statuses.success;
    }
    //错误码
    private int returnCode;
    //错误信息备注
    private String returnString;
    public static ESResult createSuccessResult(){
        return new ESResult();
    }

    public static ESResult createValidationErrorResult(){
        ESResult tmp = new ESResult();
        tmp.setReturnCode(Statuses.validationError);
        return tmp;
    }
    public boolean isSuccess(){
        return this.getReturnCode()==Statuses.success;
    }

    public int getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(int returnCode) {
        this.returnCode = returnCode;
    }

    public String getReturnString() {
        return returnString;
    }

    public void setReturnString(String returnString) {
        this.returnString = returnString;
    }
}
